package com.rupertjones.globalcron.resources;

import org.brownflat.dbinit.upgrade.Upgrade;
import org.springframework.stereotype.Component;

/**
 * <p>&copy Rupert Jones 2011,2012</p>
 *
 * @author rup
 */
@Component
public class Upgrade0022UserFullName implements Upgrade {
    @Override
    public int getSequence() {
        return 22;
    }

    @Override
    public String getSql() {
        return "ALTER TABLE `user` ADD COLUMN `full_name` VARCHAR(255) NULL;\n" +
                "ALTER TABLE `user` ADD COLUMN `last_login` TIMESTAMP NULL;\n" +
                "UPDATE `user` set full_name='Administrator' where username='admin';\n" +
                "UPDATE `user` set full_name='Unknown' where username <> 'admin';";
    }

    @Override
    public String getName() {
        return "Add full name and last login to user";
    }
}
